<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>observe (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">labs.observe</span>
</div>

<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_labs_observe_Notice.html">
          goog.labs.observe.Notice</a><br/>
        <div class="class-details">A notice object encapsulates information about a notification fired
by an observable.</div>
 </div>
 <div class="fn-constructor">
        <a href="interface_goog_labs_observe_Observable.html">
          goog.labs.observe.Observable</a><br/>
        <div class="class-details">Interface for an observable object.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_labs_observe_ObservableSet.html">
          goog.labs.observe.ObservableSet</a><br/>
        <div class="class-details">Creates a set of observables.

An ObservableSet is a collection of observables. Observers may be
reigstered and will receive notifications when any of the
observables notify. This class is meant to simplify management of
observations on multiple observables of the same nature.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_labs_observe_ObservationSet.html">
          goog.labs.observe.ObservationSet</a><br/>
        <div class="class-details">A set of observations. An observation is defined by an observable
and an observer. The set keeps track of observations and
allows their removal.</div>
 </div>
 <div class="fn-constructor">
        <a href="interface_goog_labs_observe_Observer.html">
          goog.labs.observe.Observer</a><br/>
        <div class="class-details">A class implementing <code>Observer</code> may be informed of changes in
observable object.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_labs_observe_SimpleObservable.html">
          goog.labs.observe.SimpleObservable</a><br/>
        <div class="class-details">A simple implementation of <code>goog.labs.observe.Observable</code> that can
be used as a standalone observable or as a base class for other
observable object.

When another class wants to implement observable without extending
<code>SimpleObservable</code>, they can create an instance of
<code>SimpleObservable</code>, specifying <code>opt_actualObservable</code>,
and delegate to the instance. Here is a trivial example:

<pre class="lang-js prettyprint">
ClassA = function() {
goog.base(this);
this.observable_ = new SimpleObservable(this);
this.registerDisposable(this.observable_);
};
goog.inherits(ClassA, goog.Disposable);

ClassA.prototype.observe = function(observer) {
this.observable_.observe(observer);
};

ClassA.prototype.unobserve = function(observer) {
this.observable_.unobserve(observer);
};

ClassA.prototype.notify = function(opt_data) {
this.observable_.notify(opt_data);
};
</pre></div>
 </div>
   









<div class="section">
  <table class="horiz-rule">


  </table>
</div>







      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package labs</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="labs.observe"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
